package com.wxtt.android.activity;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;

import com.fast.dev.frame.ui.Bind;
import com.wxtt.android.R;
import com.wxtt.android.common.CommonActivity;
import com.wxtt.android.iterfaces.I_Refresh;
import com.wxtt.android.view.PullRefreshView;

import cn.bingoogolapple.refreshlayout.BGARefreshLayout;

/**
 * 说明：我的消息
 * <p/>
 * 作者：fanly
 * <p/>
 * 时间：2016/1/5 14:03
 * <p/>
 * 版本：verson 1.0
 */
public class MyMessageActivity extends CommonActivity implements I_Refresh {

    @Bind(id = R.id.tv)
    private TextView tv;
    @Bind(id = R.id.bga)
    private BGARefreshLayout bga;
    private PullRefreshView refresh;

    @Override
    public int setRootView() {
        return R.layout.activity_message;
    }

    @Override
    protected boolean showToolbar() {
        return true;
    }

    @Override
    public int setToolbarTitle() {
        return R.string.navigation_item_message;
    }

    @Override
    protected void onCustomToolbar(View view, Toolbar toolbar) {
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    public void onInit(Bundle bundle) {
        refresh = new PullRefreshView(bga,tv,this);
    }

    @Override
    public void onRefesh() {
        refresh.onRefreshEnd();
    }

    @Override
    public boolean onLoadMore() {
        return true;
    }

    @Override
    public void onRefreshNotNetwork() {
        shortMessage(tv,"网络连接断开");
    }

}
